package com.kx.yooli.kx.wechat.controller.bank;

import com.kx.yooli.kx.wechat.po.paycard.WechatPaycard;
import com.kx.yooli.kx.wechat.po.result.AjaxResult;
import com.kx.yooli.kx.wechat.service.bank.BankService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *  银行卡管理
 */
@RestController
@RequestMapping("/api/bank")
public class BankController {

    @Resource
    private BankService bankService;
    /**获取银行卡列表
     * @param object ob
     * @return list
     */
    @PostMapping("getBankList")
    public AjaxResult getBankList(@RequestBody String object){
        return bankService.getBankList(object);
    }

    /**
     * 修改或新增银行卡
     * @param object ob
     * @return success
     */
    @PostMapping("updateBank")
    public AjaxResult updateBank(@RequestBody WechatPaycard object){
        return bankService.updateBank(object);
    }

    /**
     * 新增银行卡
     * @param object ob
     * @return success
     */
    @PostMapping("addBank")
    public AjaxResult addBank(@RequestBody WechatPaycard object){
        return bankService.insertBank(object);
    }
}
